package cn.xingzhe.monster.user.domain.exception;

/**
 * 验证码无效异常
 *
 * @author System
 * @version 1.0.0
 * @since 2024-01-01
 */
public class InvalidCaptchaException extends UserException {

    private static final String ERROR_CODE = "A0130";
    private static final String DEFAULT_MESSAGE = "验证码无效";

    /**
     * 构造函数
     */
    public InvalidCaptchaException() {
        super(ERROR_CODE, DEFAULT_MESSAGE);
    }

    /**
     * 构造函数
     *
     * @param message 错误消息
     */
    public InvalidCaptchaException(String message) {
        super(ERROR_CODE, message);
    }

    /**
     * 创建验证码无效异常
     *
     * @return InvalidCaptchaException
     */
    public static InvalidCaptchaException of() {
        return new InvalidCaptchaException();
    }

    /**
     * 创建验证码已过期异常
     *
     * @return InvalidCaptchaException
     */
    public static InvalidCaptchaException expired() {
        return new InvalidCaptchaException("验证码已过期");
    }

    /**
     * 创建验证码错误异常
     *
     * @return InvalidCaptchaException
     */
    public static InvalidCaptchaException incorrect() {
        return new InvalidCaptchaException("验证码错误");
    }
}

